import { http } from "@/utils/request";
import { type ReqCreatingHistory, type ResCreatingHistory } from "./types/aiDrawType";
import { type IWorkflowParams } from "@/hooks/useWorkFlowGenerate";

// 创作历史
export const getCreatingHistory = (data: ReqCreatingHistory, query?: ReqPage | null) => {
  return http.post<ResCreatingHistory>(
    "/card/vagueQueryCardPage",
    { ...data },
    { pageNum: 1, pageSize: 20, ...query },
  );
};

/**
 * 图生图
 */
export const imageToImage = (data: IWorkflowParams) => {
  return http.post<ResCreatingHistory>("/comfyUi/imageToImage", { ...data });
};

/**
 * 文生图
 */
export const textToImage = (data: IWorkflowParams) => {
  return http.post<ResCreatingHistory>("/comfyUi/textToImage", { ...data });
};
